package cn.tac.framework.core.pojo;

import java.util.HashMap;

/**
 * 错误信息管理类
 *
 * @author : tac
 * @since : 2017/7/14
 */
public class ErrorMessage {
    public ErrorMessage(HashMap<ErrorCode, String> zh) {
        this.zh = zh;
    }

    private HashMap<ErrorCode, String> zh = new HashMap<>();

    public String getErrorMessage(ErrorCode key){
        return zh.get(key);
    }

    public String getErrorMessage(ErrorCode key, Object... args){
        String msg = getErrorMessage(key);
        return String.format(msg, args);
    }
}
